package com.learn.pojo;

import java.util.List;

/**
 * @author DJJ_F
 * @version 1.0
 * @date 2025/02/23
 * @description 一对多主类
 */
public class Teacher {
    private Integer tid;
    private String tName;
//    要使用数组或集合来封装多的一方
    private List<Student> students;
    public Teacher() {
    }

    public Teacher(Integer tid, String tName, List<Student> students) {
        this.tid = tid;
        this.tName = tName;
        this.students = students;
    }

    @Override
    public String toString() {
        return "Teacher{" +
                "tid=" + tid +
                ", tName='" + tName + '\'' +
                ", students=" + students +
                '}';
    }

    public List<Student> getStudents() {
        return students;
    }

    public void setStudents(List<Student> students) {
        this.students = students;
    }

    public Integer getTid() {
        return tid;
    }

    public void setTid(Integer tid) {
        this.tid = tid;
    }

    public String gettName() {
        return tName;
    }

    public void settName(String tName) {
        this.tName = tName;
    }
}
